package com.edu.exam.enums.assessment;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 检查类型枚举
 */
@Getter
@AllArgsConstructor
public enum CheckType {
    AUTOMATIC("AUTOMATIC", "自动检查"),
    MANUAL("MANUAL", "手动检查"),
    HYBRID("HYBRID", "混合检查"),
    SCHEDULED("SCHEDULED", "计划检查"),
    ON_DEMAND("ON_DEMAND", "按需检查"),
    REAL_TIME("REAL_TIME", "实时检查"),
    BATCH("BATCH", "批量检查"),
    INCREMENTAL("INCREMENTAL", "增量检查");

    private final String code;
    private final String description;

    public static CheckType fromCode(String code) {
        for (CheckType type : values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return AUTOMATIC; // 默认返回自动检查
    }
}